package top.tenebrous.yzl.grpc.proto.authority;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.43.1)",
    comments = "Source: authority/authorityService.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class AuthorityServerGrpc {

  private AuthorityServerGrpc() {}

  public static final String SERVICE_NAME = "top.tenebrous.yzl.grpc.proto.authority.AuthorityServer";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<top.tenebrous.yzl.grpc.proto.authority.AuthorityRequest,
      top.tenebrous.yzl.grpc.proto.common.GrpcResponse> getDoAuthorityMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "DoAuthority",
      requestType = top.tenebrous.yzl.grpc.proto.authority.AuthorityRequest.class,
      responseType = top.tenebrous.yzl.grpc.proto.common.GrpcResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<top.tenebrous.yzl.grpc.proto.authority.AuthorityRequest,
      top.tenebrous.yzl.grpc.proto.common.GrpcResponse> getDoAuthorityMethod() {
    io.grpc.MethodDescriptor<top.tenebrous.yzl.grpc.proto.authority.AuthorityRequest, top.tenebrous.yzl.grpc.proto.common.GrpcResponse> getDoAuthorityMethod;
    if ((getDoAuthorityMethod = AuthorityServerGrpc.getDoAuthorityMethod) == null) {
      synchronized (AuthorityServerGrpc.class) {
        if ((getDoAuthorityMethod = AuthorityServerGrpc.getDoAuthorityMethod) == null) {
          AuthorityServerGrpc.getDoAuthorityMethod = getDoAuthorityMethod =
              io.grpc.MethodDescriptor.<top.tenebrous.yzl.grpc.proto.authority.AuthorityRequest, top.tenebrous.yzl.grpc.proto.common.GrpcResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DoAuthority"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  top.tenebrous.yzl.grpc.proto.authority.AuthorityRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  top.tenebrous.yzl.grpc.proto.common.GrpcResponse.getDefaultInstance()))
              .setSchemaDescriptor(new AuthorityServerMethodDescriptorSupplier("DoAuthority"))
              .build();
        }
      }
    }
    return getDoAuthorityMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static AuthorityServerStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<AuthorityServerStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<AuthorityServerStub>() {
        @java.lang.Override
        public AuthorityServerStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new AuthorityServerStub(channel, callOptions);
        }
      };
    return AuthorityServerStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static AuthorityServerBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<AuthorityServerBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<AuthorityServerBlockingStub>() {
        @java.lang.Override
        public AuthorityServerBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new AuthorityServerBlockingStub(channel, callOptions);
        }
      };
    return AuthorityServerBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static AuthorityServerFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<AuthorityServerFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<AuthorityServerFutureStub>() {
        @java.lang.Override
        public AuthorityServerFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new AuthorityServerFutureStub(channel, callOptions);
        }
      };
    return AuthorityServerFutureStub.newStub(factory, channel);
  }

  /**
   */
  public static abstract class AuthorityServerImplBase implements io.grpc.BindableService {

    /**
     * <pre>
     * 验证服务
     * </pre>
     */
    public void doAuthority(top.tenebrous.yzl.grpc.proto.authority.AuthorityRequest request,
        io.grpc.stub.StreamObserver<top.tenebrous.yzl.grpc.proto.common.GrpcResponse> responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDoAuthorityMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getDoAuthorityMethod(),
            io.grpc.stub.ServerCalls.asyncUnaryCall(
              new MethodHandlers<
                top.tenebrous.yzl.grpc.proto.authority.AuthorityRequest,
                top.tenebrous.yzl.grpc.proto.common.GrpcResponse>(
                  this, METHODID_DO_AUTHORITY)))
          .build();
    }
  }

  /**
   */
  public static final class AuthorityServerStub extends io.grpc.stub.AbstractAsyncStub<AuthorityServerStub> {
    private AuthorityServerStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected AuthorityServerStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new AuthorityServerStub(channel, callOptions);
    }

    /**
     * <pre>
     * 验证服务
     * </pre>
     */
    public void doAuthority(top.tenebrous.yzl.grpc.proto.authority.AuthorityRequest request,
        io.grpc.stub.StreamObserver<top.tenebrous.yzl.grpc.proto.common.GrpcResponse> responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getDoAuthorityMethod(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   */
  public static final class AuthorityServerBlockingStub extends io.grpc.stub.AbstractBlockingStub<AuthorityServerBlockingStub> {
    private AuthorityServerBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected AuthorityServerBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new AuthorityServerBlockingStub(channel, callOptions);
    }

    /**
     * <pre>
     * 验证服务
     * </pre>
     */
    public top.tenebrous.yzl.grpc.proto.common.GrpcResponse doAuthority(top.tenebrous.yzl.grpc.proto.authority.AuthorityRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getDoAuthorityMethod(), getCallOptions(), request);
    }
  }

  /**
   */
  public static final class AuthorityServerFutureStub extends io.grpc.stub.AbstractFutureStub<AuthorityServerFutureStub> {
    private AuthorityServerFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected AuthorityServerFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new AuthorityServerFutureStub(channel, callOptions);
    }

    /**
     * <pre>
     * 验证服务
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<top.tenebrous.yzl.grpc.proto.common.GrpcResponse> doAuthority(
        top.tenebrous.yzl.grpc.proto.authority.AuthorityRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getDoAuthorityMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_DO_AUTHORITY = 0;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final AuthorityServerImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(AuthorityServerImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_DO_AUTHORITY:
          serviceImpl.doAuthority((top.tenebrous.yzl.grpc.proto.authority.AuthorityRequest) request,
              (io.grpc.stub.StreamObserver<top.tenebrous.yzl.grpc.proto.common.GrpcResponse>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class AuthorityServerBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    AuthorityServerBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return top.tenebrous.yzl.grpc.proto.authority.AuthorityServiceGrpc.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("AuthorityServer");
    }
  }

  private static final class AuthorityServerFileDescriptorSupplier
      extends AuthorityServerBaseDescriptorSupplier {
    AuthorityServerFileDescriptorSupplier() {}
  }

  private static final class AuthorityServerMethodDescriptorSupplier
      extends AuthorityServerBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    AuthorityServerMethodDescriptorSupplier(String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (AuthorityServerGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new AuthorityServerFileDescriptorSupplier())
              .addMethod(getDoAuthorityMethod())
              .build();
        }
      }
    }
    return result;
  }
}
